﻿<%@ Page Language="VB" %>

<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
    Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Import Namespace='Microsoft.Reporting.WebForms' %>
<%@ Import Namespace='System.Collections.Generic' %>

<script runat="server">

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        Try
            Dim parameters = New List(Of ReportParameter)()

            Dim pDepart = New ReportParameter("str_department_code", Request.QueryString("str_department_code"))
            pDepart.Name = "str_department_code"
            parameters.Add(pDepart)
        
            Dim pMain = New ReportParameter("str_main_system_code", Request.QueryString("str_main_system_code"))
            pMain.Name = "str_main_system_code"
            parameters.Add(pMain)
        
            Dim pMenu = New ReportParameter("str_menu_system_code", Request.QueryString("str_menu_system_code"))
            pMenu.Name = "str_menu_system_code"
            parameters.Add(pMenu)
        
            Dim pStatus = New ReportParameter("str_auth_staff_status", Request.QueryString("str_auth_staff_status"))
            pStatus.Name = "str_auth_staff_status"
            parameters.Add(pStatus)
        
            ReportViewer1.LocalReport.SetParameters(parameters)
        Catch ex As Exception
            GenericHelper.ShowAlert(Me, ex)
        End Try

    End Sub
    
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <rsweb:ReportViewer ID="ReportViewer1" runat="server" Font-Names="Verdana" Font-Size="8pt"
            Height="500px" Width="100%">
            <LocalReport ReportPath="Reports\report_stp_auth_staff.rdlc">
                <DataSources>
                    <rsweb:ReportDataSource DataSourceId="ObjectDataSource1" 
                        Name="report_stp_auth_staff_USP_List_stp_auth_staff1" />
                </DataSources>
            </LocalReport>
        </rsweb:ReportViewer>
        <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
            OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" 
            TypeName="report_stp_auth_staffTableAdapters.USP_List_stp_auth_staff1TableAdapter">
            <SelectParameters>
                <asp:QueryStringParameter DefaultValue="0" Name="staff_code" 
                    QueryStringField="staff_code" Type="Int32" />
                <asp:SessionParameter Name="current_staff_code" 
                    SessionField="staff_code" Type="Int32" DefaultValue="" />
                <asp:QueryStringParameter DefaultValue="0" Name="department_code" 
                    QueryStringField="department_code" Type="Int32" />
                <asp:SessionParameter DefaultValue="" Name="group_code" 
                    SessionField="group_user_code" Type="Int32" />
                <asp:QueryStringParameter DefaultValue="0" Name="main_system_code" 
                    QueryStringField="main_system_code" Type="Int32" />
                <asp:QueryStringParameter DefaultValue="0" Name="menu_system_code" 
                    QueryStringField="menu_system_code" Type="Int32" />
                <asp:QueryStringParameter DefaultValue="0" Name="auth_staff_status" 
                    QueryStringField="auth_staff_status" Type="Int32" />
            </SelectParameters>
        </asp:ObjectDataSource>
        <%--<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" OldValuesParameterFormatString="original_{0}"
            SelectMethod="GetData" TypeName="report_stp_auth_staffTableAdapters.USP_List_stp_auth_staff1TableAdapter">
            <SelectParameters>
                <asp:QueryStringParameter DefaultValue="" Name="staff_code" QueryStringField="staff_code"
                    Type="Int32" />
                <asp:SessionParameter Name="current_staff_code" SessionField="staff_code" Type="Int32"
                    DefaultValue="" />
                <asp:QueryStringParameter DefaultValue="0" Name="department_code" QueryStringField="department_code"
                    Type="Int32" />
                <asp:QueryStringParameter DefaultValue="0" Name="group_code" QueryStringField="group_code"
                    Type="Int32" />
                <asp:QueryStringParameter DefaultValue="0" Name="main_system_code" QueryStringField="main_system_code"
                    Type="Int32" />
                <asp:QueryStringParameter DefaultValue="0" Name="menu_system_code" QueryStringField="menu_system_code"
                    Type="Int32" />
                <asp:QueryStringParameter DefaultValue="0" Name="auth_staff_status" QueryStringField="auth_staff_status"
                    Type="Int32" />
            </SelectParameters>
        </asp:ObjectDataSource>--%>
    </div>
    </form>
</body>
</html>
